package text_2023_09_22;

/**
 * @author Vv
 * @version 1.0
 * @project coding_learn
 * @description
 * @date 2023/9/22 10:24:42
 */
public class Counting {
    public String s;

    public Counting(String s) {
        this.s = s;
    }

    public int countNum() {
        char[] str = s.toCharArray();
        int count = 0;
        for (int i = 0; i < str.length; i++) {
            count += str[i] > '0' && str[i] < '9' ? 1 : 0;
        }
        return count;
    }
    public int countLowerWord(){
        char[] str = s.toCharArray();
        int count = 0;
        for(int i = 0;i<str.length;i++){
            count += str[i] > 'a' && str[i] < 'z' ? 1 : 0;
        }
        return count;
    }
    public int countUpperWord(){
        char[] str = s.toCharArray();
        int count = 0;
        for(int i = 0;i<str.length;i++){
            count += str[i] > 'A' && str[i] < 'Z' ? 1 : 0;
        }
        return count;
    }
    public int getMax(){
        int a = countLowerWord();
        int b = countNum();
        int c = countUpperWord();
        int max = a > b ? a : b;
        max = max > c ? max : c;
        return max;
    }

    public static void main(String[] args) {
        Counting a = new Counting("ejfnshjbvhrsFVFRDBGDT34567898765");
        System.out.println(a.getMax());
    }

}
